﻿using System.Threading.Tasks;
using Magicodes.ExporterAndImporter.Excel.AspNetCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NP.BPMReportPlatform.AD;
using NP.BPMReportPlatform.AD.Dto;
using NP.BPMReportPlatform.ZHLC;
using NP.BPMReportPlatform.ZHLC.Dto;
using Volo.Abp.Application.Dtos;

namespace NP.BPMReportPlatform.ZHLC
{
    /// <summary>
    /// 行政类 接口
    /// </summary>
    [Authorize]
    [ApiController]
    [Route("api/AD")]
    public class ADController : BPMReportPlatformController
    {
        private readonly IADService _aDService;

        public ADController(IADService aDService)
        {
            _aDService = aDService;
        }

        #region
        /// <summary>
        ///保险理赔登记流程 查询数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("InsuranceClaims/GetAllAsync")]
        public async Task<PagedResultDto<GetBXLPDJOutput>> GetAllAsync([FromBody] GetBXLPDJInput input)
        {
            return await _aDService.GetAllAsync(input);
        }

        /// <summary>
        /// 保险理赔登记流程  导出数据
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        [Route("InsuranceClaims/ExportAsync")]
        public async Task<XlsxFileResult<GetBXLPDJOutput>> ExportAsync([FromBody] GetBXLPDJInput input)
        {
            var rst = await _aDService.ExportAsync(input);
            return new XlsxFileResult<GetBXLPDJOutput>(rst, "导出Excel");
        }
        #endregion
    }
}